# 实现两个变量的交换

def test1():
    a = 1
    b = 2

    c = a
    a = b
    b = c

    print(a)
    print(b)


def test2():
    a = 1
    b = 2

    a = a + b
    b = a - b
    a = a - b

    print(a)
    print(b)


def test3():  # 在python中推荐此交换方式
    a = 1
    b = 2

    # a,b =(b,a)
    a, b = b, a
    print(a)
    print(b)


test1()
test2()
test3()
